package xc.com.media.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import xc.com.common.PageVo;
import xc.com.common.Result;
import xc.com.manage.media.domain.MediaFile;
import xc.com.media.service.MediaFileService;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhuolizhong
 * @since 2021-06-25
 */
@RestController
@RequestMapping("/media-file")
@CrossOrigin
public class MediaFileController {
    @Autowired
    private MediaFileService mediaFileService;
    @PostMapping("/upload")
    public Result upload(MultipartFile file){
        return mediaFileService.upload(file);
    }
    @PostMapping("/findList/{pageNum}/{pageSize}")
    public PageVo<MediaFile> findList(@PathVariable("pageNum") Integer pageNum,@PathVariable("pageSize")  Integer pageSize, @RequestBody MediaFile mediaFile){
    return mediaFileService.findList(pageNum,pageSize,mediaFile);
    }
}

